import {useSelector, useDispatch} from 'react-redux'
import {add} from '../../store/modules/countr'
function Counter(props) {
    const {count} = useSelector(state => {
       return state.countr
    })
    console.log(count, 111111111111);
    const dispath = useDispatch()
    function clickAdd() {
        const state = add()
        // 告诉store，你要修改数据源
        dispath(state)
    }
    return (
        <div>
            {count}
            <button onClick={clickAdd}>增加</button>
        </div>
    )
}   

export {Counter}